package com.sharedprint.system.menu.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sharedprint.system.menu.service.MenuService;

@Controller
@RequestMapping("/api/menu")
public class MenuController {
	private static final Logger logger=Logger.getLogger("MenuController");
	@Autowired
	private MenuService menuService;
	
	@RequestMapping("/queryLeftMenu")
	@ResponseBody
	public Map<String, Object> queryLeftMenu(HttpServletRequest req){
		Map<String, Object> resultMap=new HashMap<String, Object>();
		resultMap.put("success", "0");
		List<Map<String , Object>> leftmenuList=menuService.findLeftMenuList(null);
		
		if (leftmenuList!=null) {
			resultMap.put("menuList",leftmenuList);
			resultMap.put("success","1");
		}
		
		
		return resultMap;
	}
}
